package lambda;

import java.util.*;
/**
 * 集合排序
 */
public class LambdaDemo2 {
    public static void main(String[] args) {
        Random ran = new Random();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(ran.nextInt(99));
        }
        System.out.println(list);

        //    Collections.sort(list,(o1,o2)->o2-o1);
        list.sort((o1, o2) -> o2 - o1);
        System.out.println(list);
    }
}
